package com.zfx.pojo;

import lombok.Data;

import javax.persistence.*;
import java.io.Serializable;
import java.sql.Date;
import java.util.HashMap;


/**
 * @description: 运营账号实体类
 * @author: zfx
 */
@Data
@Table(name = "tbs_admin")
public class Admin implements Serializable {

    private static final long serialVersionUID = 1L;

    public Admin() { }

    public Admin(HashMap<String, Object> jsonMap) {
        loginId = jsonMap.get("loginId") != null ? String.valueOf(jsonMap.get("loginId")) : null;
        userName = jsonMap.get("userName") != null ? '%'+String.valueOf(jsonMap.get("userName"))+'%' : null;
        phone = jsonMap.get("phone") != null ? '%'+String.valueOf(jsonMap.get("phone"))+'%' : null;
    }

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name="id")
    private Integer id;

    @Column(name="login_id")
    private String loginId;

    @Column(name="user_name")
    private String userName;

    @Column(name="password")
    private String password;

    @Column(name="phone")
    private String phone;

    @Column(name="create_time")
    private Date createTime;

    @Column(name="update_date")
    private Date updateDate;

    @Column(name="permission")
    private String permission;
}
